Migrating from Macromedia Flash MX to Flash MX 2004
Table of Contents
- Introduction
- ActionScript in Flash MX and Flash MX 2004
- Components in Flash MX and Flash MX 2004
- Video in Flash MX and Flash MX 2004
- Data Integration in Flash MX and Flash MX 2004
- Authoring Environment Changes in Flash MX 2004
- Screens in Flash MX Professional 2004
- Flash Player 7 Enhancements and Changes
Data Integration in Flash MX and Flash MX 2004
Flash MX provides several ways to interact with external data sources, including loading and parsing XML, implementing Macromedia Flash Remoting MX technology, and socket connectivity.
In addition to these methods and techniques, Flash MX Professional 2004 offers a complete framework for data integration in your Flash applications. This framework consists of four layers: data connectivity, data management, data resolution, and data binding.
- The data connectivity layer sends and receives data from a variety of external data sources, such as web services and XML. This layer is implemented by "connector" components, including WebServiceConnector and XMLConnector.
- The data management layer sorts, filters, and searches data, as well as tracks changes made to data. The functionality of this layer is provided by the DataSet component.
- The data resolution layer encodes and decodes delta packets (which are changes made to data by the Flash client or the data source server). Delta packets are transmitted over the data connectivity layer in a format that both the external data source and Flash client can consume. This layer is implemented by the data resolver components, including RDBMSResolver and XUpdateResolver.
- The data binding layer binds external data easily to user interface components, either visually in the authoring environment or at runtime using custom ActionScript.
For more information about data integration in Flash Professional, see the Data Integration Overview on the Macromedia Flash Developer Center.
Flash Remoting is just as important as it has ever been to Macromedia customers, and Macromedia continues to sell and support Flash Remoting. Therefore, you can continue to use Flash Remoting in your applications. You can also integrate Flash Remoting with the new data management features in Flash Professional.
The Flash Remoting client-side components and tools have been updated to work in Flash MX 2004. You can download them from the Macromedia Flash Remoting MX Components page.
Using Flash Remoting with Data Components
You can continue to use Flash Remoting as you have in previous versions of Flash. You also have the option of leveraging the data management features provided by the DataSet component to manage recordsets returned by a Flash Remoting service method call. The DataSet component gives you greater control over your Flash Remoting data by making it easier to manipulate data, track changes made to data, and update the server.
The DataSet component exposes a dataProvider property,
to which you can assign any object that implements the DataProvider
API. This includes recordsets returned by Flash Remoting. For example,
suppose you create an instance of the DataSet component named remoting_ds.
The following code assigns the results of a Flash Remoting method call
named getUsers() to the DataSet object's dataProvider property:
function getUsers_Result(results){
remoting_ds.dataProvider = results;
}
You can also assign Flash Remoting recordsets directly to any component that provides a DataProvider interface, such as the DataGrid or List components.
Loading Data Across Domains
In previous versions of Flash Player a SWF that originated from one domain (for example, www.mysite.com) could load data from any server located in its same subdomain (for example, data.mysite.com). In other words, you could load data across similar domains.
In Flash Player 7 the domain of the SWF and the external data source must match exactly, otherwise the data loading call fails. For example, by default, a SWF that is loaded from www.mysite.com can only load data located at www.mysite.com.
To permit data loading across different domains, you must create a security policy file and place it on your server. A policy file indicates what domains are permitted to access data on that server. Any SWF that originates from a permitted domain can load data from that server.
For more detailed information about the new security features in Flash Player, see Deneb Meketa's article, "Security Changes in Macromedia Flash Player 7."